home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / answrbok / 8_3.lha / 8_3 / tstfile.c < prev    next >
C/C++ Source or Header  |  1993-08-08  |  558b  |  33 lines

  1. * Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */
  2. * The C++ Answer Book */
  3. * Tony Hansen */
  4. * All rights reserved. */
  5. include <stream.h>
  6. include <string.h>
  7.  
  8. /#define __cplusplus
  9. include "8_3_validfn.c"
  10. include "8_3_file.c"
  11.  
  12. / copy a stream of files
  13. include <error.h>
  14. ain(int, char**)
  15.  
  16.    for (;;)
  17. {
  18. char buf[1024];
  19. char *a = buf;
  20. if (!read_filename(cout, cin, &a))
  21.     break;
  22. cout << a << "\n";
  23. if (!cout)
  24.     break;
  25. }
  26.  
  27.    if (!cin.eof())
  28. error("error reading input");
  29.    if (cout.bad())
  30. error("error writing output");
  31.    return 0;
  32.  
  33.